<?php

class RobotBuyRandomShopAction extends SzAbstractAction
{
    Protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT
    );

    /**
     * 购买机器人随机商店的物品
     *
     * @param int $userId
     * @param int $goodsId
     * @return SzResponse
     */
    public function execute($userId, $goodsId)
    {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_TRANSACTION_FUNC)) {
            return $this->buildResponse(false);
        }
        return $this->buildResponse(
            ShopService::get()->buyRobotRandomShopItem($userId, $goodsId)
        );
    }
}